import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import checker from 'vite-plugin-checker';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    /**
     * 如果直接使用 uni()会报错 uni is not a function,
     * 详情请看：https://github.com/dcloudio/uni-app/issues/4815#issuecomment-2097341952
     */
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (uni as any).default(),
    checker({
      typescript: true,
      vueTsc: true,
      eslint: {
        useFlatConfig: true,
        lintCommand: 'eslint "./src/**/*.{ts,tsx,vue}"'
      }
    })
  ]
});
